# routers/system.py
from fastapi import APIRouter
from smartpi import base_driver

router = APIRouter(tags=["系统信息"])

@router.get("/device/info")
def device_info():
    """读取灵芯派基础信息"""
    return {
        "device_model":  base_driver.read_device_model(),
        "version":       base_driver.read_version(),
        "factory_data":  base_driver.read_factory_data(),
        "hardware_id":   base_driver.read_hardware_ID(),
        "device_name":   base_driver.read_device_name(),
        "connected":     base_driver.read_connected(),
        "battery":       base_driver.read_battery(),
    }